package com.zouxs.myTest;

public class Test2 {
    public static void main(String[] args){
        String s1 = new String("abc");// 在堆中生成空间
        String s2 = "abc"; //常量池
        System.out.println("s1 == s2 = "+s1 == s2);
        System.out.println("s1 equals  s2 = "+ s1.equals(s2));
        String s3 = s1.intern();
        System.out.println(s2 == s3);

    }
}
